package com.sys.core.utils;

import java.util.*;

/**
 * 
 * @author 汤伟杰
 *
 */
public class ListUtils {
	// 删除ArrayList中重复元素，保持顺序     
	 public static void removeDuplicateWithOrder(List list) {
	    Set set = new HashSet();
	     List newList = new ArrayList();
	   for (Iterator iter = list.iterator(); iter.hasNext();) {
	         Object element = iter.next();
	         if (set.add(element))    
	            newList.add(element);    
	      }     
	     list.clear();    
	     list.addAll(newList);    
//	    System.out.println( " remove duplicate " + list);
	 } 
}
